import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
//导入自己的页面文件
import IndexVue from '../views/index.vue'
import Student from '../views/Student.vue'
import teacher from "@/views/teacher.vue";
import course from "@/views/course.vue";
import grade from "@/views/grade.vue";

//路由规则
const routes = [
  {
    path: '/',              //路径  /代表首页
    name: 'index',         //名称
    component: IndexVue, //组件
    children:[
      {
        path: '/Student',
        name: 'Student',
        component: Student
      },
      {
        path: '/teacher',              //路径  /代表首页
        name: 'teacher',         //名称
        component: teacher  //组件
      },
      {
        path: '/course',              //路径  /代表首页
        name: 'course',         //名称
        component: course  //组件
      },
      {
        path: '/grade',              //路径  /代表首页
        name: 'grade',         //名称
        component: grade  //组件
      },
    ]
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
